HAL GFXTIM IRQ handler and callbacks functions migration

This section provides information about the HAL GFXTIM control functions migration.

HAL GFXTIM Callbacks functions

Title

HAL1

HAL2

Tearing Effect Callback

void HAL_GFXTIM_TECallback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_TearingEffectCallback(hal_gfxtim_handle_t *hgfxtim);

Absolute Frame Counter Compare1 Callback

void HAL_GFXTIM_AbsoluteTimer_AFCC1Callback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_ABSTIM_FCmpCallback(hal_gfxtim_handle_t *hgfxtim);

Absolute Frame Counter Overflow Callback

void HAL_GFXTIM_AbsoluteTimer_AFCOFCallback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_ABSTIM_FCntOverFlowCallback(hal_gfxtim_handle_t *hgfxtim);

Absolute Line Counter Compare1 Callback

void HAL_GFXTIM_AbsoluteTimer_ALCC1Callback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_ABSTIM_LCmpCallback(hal_gfxtim_handle_t *hgfxtim, hal_gfxtim_abstim_line_comp_t line_comp);

Absolute Line Counter Compare2 Callback

void HAL_GFXTIM_AbsoluteTimer_ALCC2Callback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_ABSTIM_LCmpCallback(hal_gfxtim_handle_t *hgfxtim, hal_gfxtim_abstim_line_comp_t line_comp);

Absolute Line Counter Overflow Callback

void HAL_GFXTIM_AbsoluteTimer_ALCOFCallback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_ABSTIM_LCntOverFlowCallback(hal_gfxtim_handle_t *hgfxtim);

Relative Frame Counter1 Reload Callback

void HAL_GFXTIM_RelativeTimer_RFC1RCallback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_RELTIM_FCntReloadCallback(hal_gfxtim_handle_t *hgfxtim, hal_gfxtim_reltim_counter_t counter);

Relative Frame Counter2 Reload Callback

void HAL_GFXTIM_RelativeTimer_RFC2RCallback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_RELTIM_FCntReloadCallback(hal_gfxtim_handle_t *hgfxtim, hal_gfxtim_reltim_counter_t counter);

Event Generator1 Callback

void HAL_GFXTIM_EventGenerator_EV1Callback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_EVENTGEN_EventCallback(hal_gfxtim_handle_t *hgfxtim, hal_gfxtim_eventgen_event_t event_gen);

Event Generator2 Callback

void HAL_GFXTIM_EventGenerator_EV2Callback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_EVENTGEN_EventCallback(hal_gfxtim_handle_t *hgfxtim, hal_gfxtim_eventgen_event_t event_gen);

Event Generator3 Callback

void HAL_GFXTIM_EventGenerator_EV3Callback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_EVENTGEN_EventCallback(hal_gfxtim_handle_t *hgfxtim, hal_gfxtim_eventgen_event_t event_gen);

Event Generator4 Callback

void HAL_GFXTIM_EventGenerator_EV4Callback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_EVENTGEN_EventCallback(hal_gfxtim_handle_t *hgfxtim, hal_gfxtim_eventgen_event_t event_gen);

Watchdog Timer Alarm Callback

void HAL_GFXTIM_WatchdogTimer_AlarmCallback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_WDG_AlarmCallback(hal_gfxtim_handle_t *hgfxtim);

Watchdog Timer Pre alarm Callback

void HAL_GFXTIM_WatchdogTimer_PreAlarmCallback(GFXTIM_HandleTypeDef *hgfxtim);
void HAL_GFXTIM_WDG_PreAlarmCallback(hal_gfxtim_handle_t *hgfxtim);

Error Callback

void HAL_GFXTIM_ErrorCallback(GFXTIM_HandleTypeDef *hgfxtim);
Removed :In HAL2, the GFXTIM has no errors to report.

HAL GFXTIM Callbacks register functions

In HAL1, the function HAL_GFXTIM_RegisterCallback is used to register various GFXTIM callbacks through a single with a specific callback ID, whereas, in HAL2, distinct functions are available to register each specific GFXTIM callback.

title

HAL1

HAL2

Register Tearing Effect Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_TE_CB_ID,
                            USER_GFXTIM_TearingEffectCallback);
HAL_GFXTIM_RegisterTearingEffectCallback(&gfxtim_handle,
                                         USER_GFXTIM_TearingEffectCallback);

Register Absolute Frame Counter Compare1 Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_AFC_COMPARE1_CB_ID,
                            USER_GFXTIM_ABSTIM_FrmCmpCallback);
HAL_GFXTIM_ABSTIM_RegisterFCmpCallback(&gfxtim_handle,
                                       USER_GFXTIM_ABSTIM_FrmCmpCallback);

Register Absolute Frame Counter Overflow Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_AFC_OVERFLOW_CB_ID,
                            USER_GFXTIM_ABSTIM_FrmCntOverFlowCallback);
HAL_GFXTIM_ABSTIM_RegisterFCntOverFlowCallback(&gfxtim_handle,
                                               USER_GFXTIM_ABSTIM_FrmCntOverFlowCallback);

Register Absolute Line Counter Compare1 Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_ALC_COMPARE1_CB_ID,
                            USER_GFXTIM_ABSTIM_LineCmp1Callback);
HAL_GFXTIM_ABSTIM_RegisterLCmpCallback(&gfxtim_handle,
                                       USER_GFXTIM_ABSTIM_LineCmpCallback);

Register Absolute Line Counter Compare2 Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_ALC_COMPARE2_CB_ID,
                            USER_GFXTIM_ABSTIM_LineCmp2Callback);
HAL_GFXTIM_ABSTIM_RegisterLCmpCallback(&gfxtim_handle,
                                       USER_GFXTIM_ABSTIM_LineCmpCallback);

Register Absolute Line Counter Overflow Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_ALC_OVERFLOW_CB_ID,
                            USER_GFXTIM_ABSTIM_LineCntOverFlowCallback);
HAL_GFXTIM_ABSTIM_RegisterLCntOverFlowCallback(&gfxtim_handle,
                                               USER_GFXTIM_ABSTIM_LineCntOverFlowCallback);

Register Relative Frame Counter1 Reload Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_RFC1_RELOAD_CB_ID,
                            USER_GFXTIM_RELTIM_FrmCntReload1Callback);
HAL_GFXTIM_RELTIM_FCntReloadCallback(&gfxtim_handle,
                                     USER_GFXTIM_RELTIM_FrmCntReloadCallback);

Register Relative Frame Counter2 Reload Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_RFC2_RELOAD_CB_ID,
                            USER_GFXTIM_RELTIM_FrmCntReload2Callback);
HAL_GFXTIM_RELTIM_FCntReloadCallback(&gfxtim_handle,
                                     USER_GFXTIM_RELTIM_FrmCntReloadCallback);

Register Event Generator1 Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_EVENT1_CB_ID,
                            USER_GFXTIM_EventGenerator_EV1Callback);
HAL_GFXTIM_EVENTGEN_EventCallback(&gfxtim_handle,
                                  USER_GFXTIM_EVENTGEN_EventCallback);

Register Event Generator2 Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_EVENT2_CB_ID,
                            USER_GFXTIM_EventGenerator_EV2Callback);
HAL_GFXTIM_EVENTGEN_EventCallback(&gfxtim_handle,
                                  USER_GFXTIM_EVENTGEN_EventCallback);

Register Event Generator3 Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_EVENT3_CB_ID,
                            USER_GFXTIM_EventGenerator_EV3Callback);
HAL_GFXTIM_EVENTGEN_EventCallback(&gfxtim_handle,
                                  USER_GFXTIM_EVENTGEN_EventCallback);

Register Event Generator4 Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_EVENT4_CB_ID,
                            USER_GFXTIM_EventGenerator_EV4Callback);
HAL_GFXTIM_EVENTGEN_EventCallback(&gfxtim_handle,
                                  USER_GFXTIM_EVENTGEN_EventCallback);

Register Watchdog Timer Alarm Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_WDG_ALARM_CB_ID,
                            USER_GFXTIM_WDG_AlarmCallback);
HAL_GFXTIM_WDG_AlarmCallback(&gfxtim_handle,
                             USER_GFXTIM_WDG_AlarmCallback);

Register Watchdog Timer Pre alarm Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_WDG_PREALARM_CB_ID,
                            USER_GFXTIM_WDG_PreAlarmCallback);
HAL_GFXTIM_WDG_PreAlarmCallback(&gfxtim_handle,
                                USER_GFXTIM_WDG_PreAlarmCallback);

Register Error Callback

HAL_GFXTIM_RegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_ERROR_CB_ID,
                            USER_GFXTIM_ErrorCallback);
Removed :In HAL2, the GFXTIM has no errors to report.

HAL GFXTIM Callbacks unregister functions

In HAL2, the unregister callback API has been removed. Instead, callbacks can be managed by re-registering the default

HAL GFXTIM weak callbacks as needed.

title

HAL1

HAL2

UnRegister Tearing Effect Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                              HAL_GFXTIM_TE_CB_ID);
HAL_GFXTIM_RegisterTearingEffectCallback(&gfxtim_handle,
                                         HAL_GFXTIM_TearingEffectCallback);

UnRegister Absolute Frame Counter Compare1 Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_AFC_COMPARE1_CB_ID);
HAL_GFXTIM_ABSTIM_RegisterFCmpCallback(&gfxtim_handle,
                                       HAL_GFXTIM_ABSTIM_FCmpCallback);

UnRegister Absolute Frame Counter Overflow Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                              HAL_GFXTIM_AFC_OVERFLOW_CB_ID);
HAL_GFXTIM_ABSTIM_RegisterFCntOverFlowCallback(&gfxtim_handle,
                                               HAL_GFXTIM_ABSTIM_FCntOverFlowCallback);

UnRegister Absolute Line Counter Compare1 Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                              HAL_GFXTIM_ALC_COMPARE1_CB_ID);
HAL_GFXTIM_ABSTIM_RegisterLCmpCallback(&gfxtim_handle,
                                       HAL_GFXTIM_ABSTIM_LCmpCallback);

UnRegister Absolute Line Counter Compare2 Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                              HAL_GFXTIM_ALC_COMPARE2_CB_ID);
HAL_GFXTIM_ABSTIM_RegisterLCmpCallback(&gfxtim_handle,
                                       HAL_GFXTIM_ABSTIM_LCmpCallback);

UnRegister Absolute Line Counter Overflow Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                              HAL_GFXTIM_ALC_OVERFLOW_CB_ID,);
HAL_GFXTIM_ABSTIM_RegisterLCntOverFlowCallback(&gfxtim_handle,
                                               HAL_GFXTIM_ABSTIM_LCntOverFlowCallback);

UnRegister Relative Frame Counter1 Reload Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                              HAL_GFXTIM_RFC1_RELOAD_CB_ID);
HAL_GFXTIM_RELTIM_FCntReloadCallback(&gfxtim_handle,
                                     HAL_GFXTIM_RELTIM_FCntReloadCallback);

UnRegister Relative Frame Counter2 Reload Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                              HAL_GFXTIM_RFC2_RELOAD_CB_ID);
HAL_GFXTIM_RELTIM_FCntReloadCallback(&gfxtim_handle,
                                     HAL_GFXTIM_RELTIM_FCntReloadCallback);

UnRegister Event Generator1 Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                              HAL_GFXTIM_EVENT1_CB_ID);
HAL_GFXTIM_EVENTGEN_EventCallback(&gfxtim_handle,
                                  HAL_GFXTIM_EVENTGEN_EventCallback);

UnRegister Event Generator2 Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_EVENT2_CB_ID);
HAL_GFXTIM_EVENTGEN_EventCallback(&gfxtim_handle,
                                  HAL_GFXTIM_EVENTGEN_EventCallback);

Register Event Generator3 Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                              HAL_GFXTIM_EVENT3_CB_ID);
HAL_GFXTIM_EVENTGEN_EventCallback(&gfxtim_handle,
                                  HAL_GFXTIM_EVENTGEN_EventCallback);

UnRegister Event Generator4 Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                              HAL_GFXTIM_EVENT4_CB_ID);
HAL_GFXTIM_EVENTGEN_EventCallback(&gfxtim_handle,
                                  HAL_GFXTIM_EVENTGEN_EventCallback);

UnRegister Watchdog Timer Alarm Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                              HAL_GFXTIM_WDG_ALARM_CB_ID,);
HAL_GFXTIM_WDG_AlarmCallback(&gfxtim_handle,
                             HAL_GFXTIM_WDG_AlarmCallback);

UnRegister Watchdog Timer Pre alarm Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                              HAL_GFXTIM_WDG_PREALARM_CB_ID);
HAL_GFXTIM_WDG_PreAlarmCallback(&gfxtim_handle,
                                HAL_GFXTIM_WDG_PreAlarmCallback);

UnRegister Error Callback

HAL_GFXTIM_UnRegisterCallback(&gfxtim_handle,
                            HAL_GFXTIM_ERROR_CB_ID);
Removed :In HAL2, the GFXTIM has no errors to report.

Related concept: Individual callback registration APIs replace global register and unregister functions


HAL GFXTIM IRQ handlers

HAL1

HAL2

HAL_GFXTIM_IRQHandler(GFXTIM_HandleTypeDef *hgfxtim);
HAL_GFXTIM_IRQHandler(hal_gfxtim_handle_t *hgfxtim);
HAL_GFXTIM_TearingEffectIRQHandler(hal_gfxtim_handle_t *hgfxtim);
HAL_GFXTIM_ABSTIM_FrameIRQHandler(hal_gfxtim_handle_t *hgfxtim);
HAL_GFXTIM_ABSTIM_LineIRQHandler(hal_gfxtim_handle_t *hgfxtim);
HAL_GFXTIM_RELTIM_IRQHandler(hal_gfxtim_handle_t *hgfxtim);
HAL_GFXTIM_EVENTGEN_IRQHandler(hal_gfxtim_handle_t *hgfxtim);
HAL_GFXTIM_WDG_IRQHandler(hal_gfxtim_handle_t *hgfxtim);